home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Programming / AmigaE / Src / Various / 2ndMousePort.e next >
Text File  |  1992-09-02  |  703b  |  29 lines

  1. -> switches mouseports
  2.  
  3. OPT OSVERSION=37
  4.  
  5. MODULE 'devices/input', 'exec/io'
  6.  
  7. PROC main()
  8.   DEF request=NIL:PTR TO iostd,port=NIL
  9.   IF port:=CreateMsgPort()
  10.     IF request:=CreateIORequest(port,SIZEOF iostd)
  11.       IF OpenDevice('input.device',0,request,0)=0
  12.         request.command:=IND_SETMPORT
  13.         request.data:=[1]:CHAR          -> 0 for original port, 1 for joyport
  14.         request.length:=1
  15.         DoIO(request)
  16.         CloseDevice(request)
  17.       ELSE
  18.         PutStr('Could not open input device\n')
  19.       ENDIF
  20.       DeleteIORequest(request)
  21.     ELSE
  22.       PutStr('Could not create iorequest\n')
  23.     ENDIF
  24.     DeleteMsgPort(port)    
  25.   ELSE
  26.     PutStr('Could not open port\n')
  27.   ENDIF
  28. ENDPROC
  29.